package com.yy.wga.mp.module.merchant.controller;


import com.yy.wga.common.core.dto.Result;
import com.yy.wga.common.utils.mapping.BeansUtils;
import com.yy.wga.merchant.feign.api.MerchantShareContentFeign;
import com.yy.wga.mp.module.merchant.response.MerchantShareContentInfoResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 分销文案配置
 *
 * @author guochao
 * @since 2024-11-10 21:11:06
 */
@RestController
@RequestMapping("api/merchant/shareContent")
public class MerchantShareContentController {
    /**
     * 服务对象
     */
    @Resource
    private MerchantShareContentFeign merchantShareContentFeign;

    /**
     * 查询
     * @return
     */
    @GetMapping("get")
    public Result<MerchantShareContentInfoResponse> get() {
        Result<com.yy.wga.merchant.feign.response.MerchantShareContentInfoResponse> shareContentResult = merchantShareContentFeign.get();
        if (!shareContentResult.isSuccess()) {
            return Result.fail(shareContentResult.getCode(), shareContentResult.getMessage());
        }
        return Result.success(BeansUtils.map(shareContentResult, MerchantShareContentInfoResponse.class));
    }
}
